package com.liunian.subject.domain.entity;

import com.liunian.subject.common.enums.IsDeletedFlagEnum;
import com.liunian.subject.infra.basic.entity.SubjectCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@ApiModel(value = "题目类别领域对象BO")
public class SubjectCategoryBO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "分类类别")
    private Integer categoryType;

    @ApiModelProperty(value = "图标链接")
    private String imageUrl;

    @ApiModelProperty(value = "父级id")
    private Long parentId;

    public SubjectCategory subjectCategoryBOtoEntity() {
        SubjectCategory entity = new SubjectCategory();
        entity.setId(this.id);
        entity.setCategoryName(this.categoryName);
        entity.setCategoryType(this.categoryType);
        entity.setImageUrl(this.imageUrl);
        entity.setParentId(this.parentId);
        return entity;
    }

    public SubjectCategoryBO subjectCategoryEntityToBO(SubjectCategory subjectCategory) {
        SubjectCategoryBO bo = new SubjectCategoryBO();
        bo.setId(subjectCategory.getId());
        bo.setCategoryType(subjectCategory.getCategoryType());
        bo.setCategoryName(subjectCategory.getCategoryName());
        bo.setImageUrl(subjectCategory.getImageUrl());
        bo.setParentId(subjectCategory.getParentId());
        return bo;
    }

}